package com.bwie.controller;

import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.R;
import com.bwie.vo.BrandVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小薛超人
 * @version 1.0
 * @description: TODO
 * @date 2025/7/19 11:31
 */
@RestController
@RequestMapping("/prod/index")
@Api(tags = "商品操作")
public class IndexController {

    @Autowired
    TbBrandService tbBrandService;

    @PostMapping("/getBrandList")
    @ApiOperation(value = "品牌列表")
    public R getBrandList(@RequestBody BrandVo brandVo){
        return tbBrandService.getBrandList(brandVo);
    }

    @PostMapping("/changeBrandStatus")
    @ApiOperation(value = "修改状态")
    public R changeBrandStatus(@RequestBody TbBrand tbBrand){
        return tbBrandService.changeBrandStatus(tbBrand);
    }

    @PostMapping("/AddBrand")
    @ApiOperation(value = "添加品牌")
    public R AddBrand(@RequestBody @Validated TbBrand tbBrand){
        return tbBrandService.AddBrand(tbBrand);
    }
}
